// *Author：jxx
// *Contact：283591387@qq.com
// *代码由框架生成,任何更改都可能导致被代码生成器覆盖
export default function(){
    const table = {
        key: 'Id',
        footer: "Foots",
        cnName: '常见缺陷',
        name: 'Flaws',
        url: "/Flaws/",
        sortName: "Id"
    };
    const tableName = table.name;
    const tableCNName = table.cnName;
    const newTabEdit = false;
    const key = table.key;
    const editFormFields = {"FlawDesc":"","DetectType":"","FlawGrade":""};
    const editFormOptions = [[{"title":"缺陷描述","field":"FlawDesc","type":"textarea","required": true,"maxlength": 500,"validator": (rule, val) => {
        if (!val || val.trim().length < 5) {
            return "缺陷描述至少需要5个字符";
        }
        return "";
    }}],
                              [{"dataKey":"检测项类型","data":[],"title":"检测类型","field":"DetectType","type":"select","required": true}],
                              [{"dataKey":"缺陷等级","data":[],"title":"缺陷等级","field":"FlawGrade","type":"select","required": true}]];
    const searchFormFields = {"FlawDesc":"","DetectType":"","FlawGrade":""};
    const searchFormOptions = [[{"title":"缺陷描述","field":"FlawDesc"},{"dataKey":"检测项类型","data":[],"title":"检测类型","field":"DetectType","type":"select"},{"dataKey":"缺陷等级","data":[],"title":"缺陷等级","field":"FlawGrade","type":"select"}]];
    const columns = [{field:'Id',title:'主键',type:'int',width:120,require:true,align:'left'},
                       {field:'FlawDesc',title:'缺陷描述',type:'string',width:120,align:'left'},
                       {field:'DetectType',title:'检测类型',type:'string',bind:{ key:'检测项类型',data:[]},width:120,align:'left'},
                       {field:'FlawGrade',title:'缺陷等级',type:'string',bind:{ key:'缺陷等级',data:[]},width:120,align:'left'}];
    const detail ={columns:[]};
    const details = [];

    return {
        table,
        key,
        tableName,
        tableCNName,
        newTabEdit,
        editFormFields,
        editFormOptions,
        searchFormFields,
        searchFormOptions,
        columns,
        detail,
        details
    };
}